SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO

/*
----------------------------------------------------------------------------------------------------

-- Created By:  ()
-- Purpose: Inserts a record into the UserAccount table
----------------------------------------------------------------------------------------------------
*/


CREATE PROCEDURE dbo.UserAccount_Insert
(

	@Id int    OUTPUT,

	@Username varchar (50)  ,

	@Title nvarchar (20)  ,

	@FirstName nvarchar (50)  ,

	@LastName nvarchar (50)  ,

	@Password nvarchar (50)  ,

	@PasswordSalt nvarchar (50)  ,

	@LastLogin datetime   ,

	@UserType int   ,

	@CreatedDate datetime   ,

	@UpdatedDate datetime   ,

	@CreatedUser varchar (50)  ,

	@UpdatedUser varchar (50)  ,

	@IsActivity bit   
)
AS


				
				INSERT INTO [dbo].[UserAccount]
					(
					[Username]
					,[Title]
					,[FirstName]
					,[LastName]
					,[Password]
					,[PasswordSalt]
					,[LastLogin]
					,[UserType]
					,[CreatedDate]
					,[UpdatedDate]
					,[CreatedUser]
					,[UpdatedUser]
					,[IsActivity]
					)
				VALUES
					(
					@Username
					,@Title
					,@FirstName
					,@LastName
					,@Password
					,@PasswordSalt
					,@LastLogin
					,@UserType
					,@CreatedDate
					,@UpdatedDate
					,@CreatedUser
					,@UpdatedUser
					,@IsActivity
					)
				
				-- Get the identity value
				SET @Id = SCOPE_IDENTITY()
									
							
			

GO
